#include<stdio.h>
#include<iostream>
#include<string.h>
using namespace std;
char change(char ch)
{
	if (ch >= 'a' && ch <= 'z')return ch + ('A' - 'a');
	else if (ch >= 'A' && ch <= 'Z')return ch + ('a' - 'A');
	else return ch;
}
int main()
{
	char key[100 + 5];
	while (cin >> key)
	{
		for (int i = 0; i < strlen(key); i++)key[i] = change(key[i]);
		cout << key << "\r\n";
	}
	return 0;
}